#include "downloadinfo.h"

qint32 DownloadInfo::maxNumber = 0;

DownloadInfo::DownloadInfo(QString localAddress, QString internetAddress, quint8 priority, double progress) {
    number = ++maxNumber;
    this->localAddress = localAddress;
    this->internetAddress = internetAddress;
    this->priority = priority;
    this->progress = progress;
}


quint32 DownloadInfo::getNumber() const{
    return number;
}


const QString& DownloadInfo::getLocalAddress() const{
    return localAddress;
}

const QString& DownloadInfo::getInternetAddress() const{
    return internetAddress;
}

quint8 DownloadInfo::getPriority() const{
    return priority;
}

double DownloadInfo::getProgress() const {
    return progress;
}

void DownloadInfo::setProgress(double progress) {
    this->progress = progress;
}



bool DownloadInfo::DownloadInfoComparator::operator()(const DownloadInfo* const t1, const DownloadInfo* const t2) const
{
    return t1->getPriority() < t2->getPriority();
}
